{extend name="common:main" /}
{block name="cssjs"}
<script src="__PUBLIC__/static/js/admin/index.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
<div class="row">
	<div class="col-lg-3 col-sm-6 col-xs-12">
		<div class="info-box">
			<span class="info-box-icon bg-aqua"><i class="icon ion-ios-pulse"></i></span>
			<div class="info-box-content">
				<div class="info-box-text">今日采集</div>
				<div class="info-box-number">{$runInfo['today_success']|intval}<div class="tips">条成功</div></div>
				<div class="info-box-number">{$runInfo['today_error']|intval}<div class="tips">条失败</div></div>
			</div>
		</div>
	</div>
	<div class="col-lg-3 col-sm-6 col-xs-12">
		<div class="info-box">
			<span class="info-box-icon bg-red"><i class="icon ion-stats-bars"></i></span>
			<div class="info-box-content">
				<div class="info-box-text">已采集数据</div>
				<div class="info-box-number">{$runInfo['total_success']|intval}<div class="tips">条成功</div></div>
				<div class="info-box-number">{$runInfo['total_error']|intval}<div class="tips">条失败</div></div>
			</div>
		</div>
	</div>
	<div class="clearfix visible-sm-block"></div>
	<div class="col-lg-3 col-sm-6 col-xs-12">
		<div class="info-box">
			<span class="info-box-icon bg-green"><i class="icon ion-ios-settings-strong"></i></span>
			<div class="info-box-content">
				<div class="info-box-text">任务</div>
				<div class="info-box-number">{$runInfo['task_auto']|intval}<div class="tips">个自动任务</div></div>
				<div class="info-box-number">{$runInfo['task_other']|intval}<div class="tips">个手动任务</div></div>
			</div>
		</div>
	</div>
	<div class="col-lg-3 col-sm-6 col-xs-12">
		<div class="info-box">
			<span class="info-box-icon bg-yellow"><i class="icon ion-load-b"></i></span>
			<div class="info-box-content">
				<div class="info-box-text">自动采集</div>
				<div class="info-box-number" style="margin-top:7px;">{$runInfo['auto_status']}</div>
			</div>
		</div>
	</div>
</div>
<div class="box box-default">
	<div class="box-body">
		<div class="row">
		    <div class="col-sm-6">
			<table class="table table-bordered table-striped" style="margin-bottom:0;">
		      <tbody>
		        <tr>
		          <th style="width:90px;">检测更新</th>
		          <td>
		          	<div id="upgrade_check"></div>
		          	<textarea id="upgrade_error" rows="5" class="form-control" style="display:none;margin-top:10px;"></textarea>
		          </td>
		        </tr>
		        {if condition="$upgradeDb"}
		        <tr>
		          <th>升级数据库</th>
		          <td><a href="javascript:;" id="upgrade_db">点击升级数据库</a></td>
		        </tr>
		        {/if}
		        <tr>
		          <th>当前版本</th>
		          <td>SkyCaiji V{$serverData['version']}</td>
		        </tr>
		        {if condition="isset($serverData['caiji'])"}
		        <tr>
		          <th>采集状态</th>
		          <td>{$serverData['caiji']}</td>
		        </tr>
		        {/if}
		        <tr>
		          <th>官方网站</th>
		          <td>
		          	<ul class="in-line-mg">
		          		<li><a href="http://bbs.skycaiji.com" target="_blank">社区</a></li>
		          		<li><a href="https://www.skycaiji.com" target="_blank">官网</a></li>
		          	</ul>
		          </td>
		        </tr>
		        <tr>
		          <th>清除缓存</th>
		          <td><a href="javascript:;" id="op_clean">清除缓存</a></td>
		        </tr>
		      </tbody>
		    </table>
		    </div>
		    <div class="col-sm-6">
			<table class="table table-bordered table-striped" style="margin-bottom:0;">
		      <tbody>
		        <tr>
		          <th style="width:90px;">操作系统</th>
		          <td>{$serverData['os']}</td>
		        </tr>
		        <tr>
		          <th>运行环境</th>
		          <td>{$serverData['server']}</td>
		        </tr>
		        <tr>
		          <th>数据库</th>
		          <td>{$serverData['db']}</td>
		        </tr>
		        <tr>
		          <th>PHP版本</th>
		          <td>{$serverData['php']}</td>
		        </tr>
		        <tr>
		          <th>上传限制</th>
		          <td>{$serverData['upload_max']}</td>
		        </tr>
		      </tbody>
		    </table>
		    </div>
		</div>
	</div>
</div>
{if !empty($openBasedir)}
<div class="alert alert-warning alert-dismissible" id="box_open_basedir">
	<button type="button" class="close">×</button>
	您的网站开启了目录访问限制(open_basedir)，受保护的站点目录：{$openBasedir}，这会影响到站点目录外的文件读写和CMS程序的访问。如果您未更改图片保存目录(站点目录外)并且cms程序都在站点目录内则可忽略该问题！
</div>
{/if}
{if !empty($systemWarning)}
<div class="alert alert-danger">
	{if !empty($systemWarning['php'])}
		PHP缺少功能：{:implode(' , ',$systemWarning['php'])}<br/>
	{/if}
	{if !empty($systemWarning['path_write'])}
		请设置可写权限：{:implode(' , ',$systemWarning['path_write'])}<br/>
	{/if}
	{if !empty($systemWarning['path_read'])}
		请设置可读权限：{:implode(' , ',$systemWarning['path_read'])}<br/>
	{/if}
</div>
{/if}
<div id="invalid_list" style="display:none;">
	<div class="alert alert-danger">
		功能失效：<div data-box="1" style="display:inline;"></div>
	</div>
</div>

<div class="box box-default">
	<div class="box-header with-border">
		<h3 class="box-title" style="font-size:16px;">系统消息</h3>
		<div class="box-tools pull-right">
			<button class="btn btn-box-tool" id="refresh_admin_index"><i class="fa fa-refresh"></i></button>
		</div>
	</div>
	<div class="box-body" id="skycaiji_admin_index" style="padding:0;">
		{if !empty($adminIndexData)}
			{$adminIndexData['html']}
		{/if}
	</div>
	<div class="overlay" style="display:none;">
		<i class="fa fa-refresh fa-spin"></i>
	</div>
</div>
{/block}